package thread.util;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.net.URL;

/**
 * web downloader
 *
 * @author dingwen
 * @date 2021/09/05
 */
public class WebDownloaderUtil {
    private WebDownloaderUtil() {
    }

    public static void downloader(String url, String name) {
        try {
            FileUtils.copyURLToFile(new URL(url), new File(name));
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println("WebDownloader 下载异常");
        }
    }
}
